<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的微博</title>
</head>
<body>
<h1>我的微博</h1>
<div>
    <div v-for="weibo in arr">
        <h3>{{weibo.title}}<a href="javascript:void(0)" @click="del(weibo.id)">   删除</a></h3>
        <p>{{weibo.content}}</p>
        <img :src="weibo.url" style="width: 200px" alt="">
    </div>
</div>

<!--引入axios和vue-->
<script src="js/axios.min.js"></script>
<script src="js/vue.js"></script>
<script>
    let v = new Vue({
        el:"body>div",
        data:{
            arr:[]
        },
        created:function () {
            axios.get("/weibo/select/my").then(function (response) {
                v.arr = response.data;
            })
        },
        methods:{
            del:function (id) {
                axios.get("/delete?id="+id).then(function () {
                    location.reload(); //刷新页面
                })
            }
        }
    })
</script>
</body>
</html>